#include "node.h"

int Node::ID=1;

Node* Node::createNode() {
	Node* node=new Node();
	node->id=ID++;
	node->value=0;
	node->leftpointer=0;
	node->rightpointer=0;
	node->depth=0;
	return node;
}

void Node::add_arg(int token_type, char *c) {
	string tmp="";
	for (int i=0;;i++) {
		if (c[i]=='\0') break;
		tmp+=c[i];
	}
	token_args.push_back(token_type);
	name_args.push_back(tmp);
}

void Node::add_arg(int token_type, string s) {
	token_args.push_back(token_type);
	name_args.push_back(s);
}
